<include file="../header" title="review" />
<div id="review_wrapper">
    <if condition="$stat eq false">

        <div class="error">
            <div class="title">
                <h1>{$error}</h1>
            </div>
        </div>

    <else/>
        <eq name="review_ans" value="1">
            <div class="survey">
                <div class="title">
                    <h1>{:L('survey')}</h1>
                </div>
                <div class="body">
                    <p class="question">
                        <eq name="lang" value="en-us">
                            Could you submit the full paper / extended abstract before August 30, 2013.
                        <else/>
                            请估计一下，您是否能在8月30日前提交论文全文？
                        </eq>
                    </p>
                    <p class="answer">
                        <if condition="$haveVoted">
                            <input type="checkbox" checked disabled/>
                            <eq name="lang" value="en-us">
                                Voted
                            <else/>
                                已投票
                            </eq>
                        <else/>
                            <a href="###" class="survey-btn" lang="yes">{:L('yes')}</a>
                            <a href="###" class="survey-btn" lang="no">{:L('no')}</a>
                        </if>
                    </p>
                </div>
            </div>
        </eq>
        <div class="result">
            <div class="title">
                <h1>
                    <eq name="lang" value="en-us">
                        Result of review
                    <else/>
                        摘要评阅结果
                    </eq>
                </h1>
            </div>
            <div class="body">
                <p class="ans">
                    <if condition="$review_ans eq 0">
                        <eq name="lang" value="en-us">
                            You haven't submitted any abstract.
                        <else/>
                            您没有提交过摘要。
                        </eq>
                    <elseif condition="$review_ans eq 1" />
                        <eq name="lang" value="en-us">
                            Congratulation! Your abstract has been accepted.
                        <else/>
                            恭喜！您的论文摘要已通过评审。
                        </eq>
                    <elseif condition="$review_ans eq 2" />
                        <eq name="lang" value="en-us">
                            Sorry! Your abstract has been rejected.
                        <else/>
                            很遗憾！您的论文摘要未通过评审。
                        </eq>
                    <else/>
                        <eq name="lang" value="en-us">
                             Sorry! Our staff are still working at it. Please try again later.
                        <else/>
                            抱歉！数据尚未录入系统，请稍后再试。
                        </eq>
                    </if>
                </p>
                <if condition="$hashAdvice">
                    <p class="advice">
                        <span class="prefix">
                            <eq name="lang" value="en-us">
                                Advice: 
                            <else/>
                                主要评阅意见：
                            </eq>
                        </span>
                        <br/>
                        {$review_advice|nl2br}
                    </p>
                </if>
            </div>
        </div>

    </if>
</div>
<include file="../footer" />
<eq name="review_ans" value="1">
    <script type="text/javascript">
        var p = {
            'uid' : {$account.uid},
            'password' : '{$account.passwd}' 
        }, isSending = false;
        $('.survey-btn').click(function(){
            if (isSending) return false;
            isSending = true;
            if (this.lang=='yes') {
                p.can = 1;
            } else {
                p.can = 0;
            }
            $.post("{:U('Review/survey')}", p, function (e) {
                $('#review_wrapper .survey .answer').html(e.msg);
            }, 'json');
            return false;
        });
    </script>
</eq>